l105/H11 uitleg/11.8.php

<?php $kleur = $_POST["kleur"]; ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <style> body { background-color: #<?php echo $kleur ?>; } </style> </head> <body> <form method = 'post' action=""> <input type='radio' id ='rood'name ='kleur' value="FF0000"> <label for="rood">Rood</label> <input type='radio' id='blauw' name='kleur' value="0000FF"> <label for="blauw">Blauw</label> <input type="radio" id="groen" name="kleur" value="00FF00"> <label for="groen">Groen</label> <br> <input type="submit" value="Kies je deze?"> </form> </body> </html>

Resultaat

Made by Thijs Aarnoudse